import request from '@/utils/request'

/**
 * 查询歌单列表
 * @param userId
 * @returns
 */
export function getUserSheet(userId: number) {
  return request({
    url: `/sheet/getUserSheet/${userId}`,
    method: 'get'
  })
}

/**
 * 新增歌单
 * @param data
 * @returns
 */
export function saveSheet(data: any) {
  return request({
    url: '/sheet/addSheet',
    method: 'post',
    data
  })
}

/**
 * 删除歌单
 * @param sheetId
 * @returns
 */
export function deleteSheet(sheetId: number | string) {
  return request({
    url: `/sheet/deleteSheet/${sheetId}`,
    method: 'delete'
  })
}

/**
 * 修改歌单
 * @param data
 * @returns
 */
export function updateSheet(data: any) {
  return request({
    url: '/sheet/updateSheet',
    method: 'post',
    data
  })
}

/**
 * 添加歌曲至歌单中
 * @param data
 * @returns
 */
export function addSong(data: any) {
  return request({
    url: '/sheet/addSong',
    method: 'post',
    data
  })
}

/**
 * 获取歌单列表
 * @param sheetId
 * @returns
 */
export function getSheetSong(sheetId: number) {
  return request({
    url: `/sheet/getSheetSong/${sheetId}`,
    method: 'get'
  })
}

/**
 * 将歌单的歌曲删除
 * @param data
 * @returns
 */
export function deleteSheetSong(data: any) {
  return request({
    url: '/sheet/deleteSheetSong',
    method: 'delete',
    data
  })
}
